<?php       
/* Posted variables from ITN */
$pfData = $_POST;
$myfile = fopen("transaction_id.txt", "w") or die("Unable to open file!");
$payment_id = $pfData["pf_payment_id"];
/* foreach($pfData as $key => $val){
  if($key == "pf_payment_id"){
		$txt = $val;
  }
} */
fwrite($myfile, $payment_id);
fclose($myfile);
?>